package se.webbzon.boltzmann.game;

import java.util.Date;

public class OnlineLicense {
	
	// The id of this online license
	private final int id;
	
	// Whatever this online license is active or not
	private final boolean active;
	
	// The free time expire date of this online license (unix timestamp)
	private final Date freeExpire;
	
	// The current and maximal number of games that may be created for this license
	private int currentGames;
	private final int maxGames;
	
	/*============================================================
	Constructors
	============================================================*/
	
	public OnlineLicense(int id, boolean active, Date freeExpire, int currentGames, int maxGames) {
		this.id = id;
		this.active = active;
		this.freeExpire = freeExpire;
		this.currentGames = currentGames;
		this.maxGames = maxGames;
	}
	
	/*============================================================
	Public Methods
	============================================================*/
	
	/** Returns the id of this online license. **/
	public int getId() {
		return id;
	}

	/** Returns true if this online license is active. **/
	public boolean isActive() {
		return active;
	}

	/** Returns the free time expire date. **/
	public Date getFreeExpire() {
		return freeExpire;
	}
	
	/** Sets the current number of games associated to this online license. **/
	public void setCurrentGames(int currentGames) {
		this.currentGames = currentGames;
	}

	/** Returns the current number of games associated to this online license. **/
	public int getCurrentGames() {
		return currentGames;
	}

	/** Returns the maximal number of games that may be created for this online license. **/
	public int getMaxGames() {
		return maxGames;
	}

}
